home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / latex209 / contrib / acs / acs.bst < prev    next >
Text File  |  1993-08-02  |  17KB  |  950 lines

  1. % BibTeX standard bibliography style `ACS'
  2.     % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
  3.     % Copyright (C) 1985, all rights reserved.
  4.     % Copying of this file is authorized only if either
  5.     % (1) you make absolutely no changes to your copy, including name, or
  6.     % (2) if you do make changes, you name it something other than
  7.     % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
  8.     % This restriction helps ensure that all standard styles are identical.
  9.     % The file btxbst.doc has the documentation for this style.
  10.  
  11. ENTRY
  12.   { address
  13.     author
  14.     booktitle
  15.     chapter
  16.     edition
  17.     editor
  18.     howpublished
  19.     institution
  20.     journal
  21.     key
  22.     month
  23.     note
  24.     number
  25.     organization
  26.     pages
  27.     publisher
  28.     school
  29.     series
  30.     title
  31.     type
  32.     volume
  33.     year
  34.   }
  35.   {}
  36.   { label }
  37.  
  38. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  39.  
  40. FUNCTION {init.state.consts}
  41. { #0 'before.all :=
  42.   #1 'mid.sentence :=
  43.   #2 'after.sentence :=
  44.   #3 'after.block :=
  45. }
  46.  
  47. STRINGS { s t }
  48.  
  49. FUNCTION {output.nonnull}
  50. { 's :=
  51.   output.state mid.sentence =
  52.     { " " * write$ }
  53.     { output.state after.block =
  54.     { ", " * write$
  55.       newline$
  56.       "\newblock " write$
  57.     }
  58.     { output.state before.all =
  59.         'write$
  60.         { add.period$ " " * write$ }
  61.       if$
  62.     }
  63.       if$
  64.       mid.sentence 'output.state :=
  65.     }
  66.   if$
  67.   s
  68. }
  69.  
  70. FUNCTION {output}
  71. { duplicate$ empty$
  72.     'pop$
  73.     'output.nonnull
  74.   if$
  75. }
  76.  
  77. FUNCTION {output.check}
  78. { 't :=
  79.   duplicate$ empty$
  80.     { pop$ "empty " t * " in " * cite$ * warning$ }
  81.     'output.nonnull
  82.   if$
  83. }
  84.  
  85. FUNCTION {output.bibitem}
  86. { newline$
  87.   "\bibitem{" write$
  88.   cite$ write$
  89.   "}" write$
  90.   newline$
  91.   ""
  92.   before.all 'output.state :=
  93. }
  94.  
  95. FUNCTION {fin.entry}
  96. { add.period$
  97.   write$
  98.   newline$
  99. }
  100.  
  101. FUNCTION {new.block}
  102. { output.state before.all =
  103.     'skip$
  104.     { after.block 'output.state := }
  105.   if$
  106. }
  107.  
  108. FUNCTION {new.sentence}
  109. { output.state after.block =
  110.     'skip$
  111.     { output.state before.all =
  112.     'skip$
  113.     { after.sentence 'output.state := }
  114.       if$
  115.     }
  116.   if$
  117. }
  118.  
  119. FUNCTION {not}
  120. {   { #0 }
  121.     { #1 }
  122.   if$
  123. }
  124.  
  125. FUNCTION {and}
  126. {   'skip$
  127.     { pop$ #0 }
  128.   if$
  129. }
  130.  
  131. FUNCTION {or}
  132. {   { pop$ #1 }
  133.     'skip$
  134.   if$
  135. }
  136.  
  137. FUNCTION {new.block.checka}
  138. { empty$
  139.     'skip$
  140.     'new.block
  141.   if$
  142. }
  143.  
  144. FUNCTION {new.block.checkb}
  145. { empty$
  146.   swap$ empty$
  147.   and
  148.     'skip$
  149.     'new.block
  150.   if$
  151. }
  152.  
  153. FUNCTION {new.sentence.checka}
  154. { empty$
  155.     'skip$
  156.     'new.sentence
  157.   if$
  158. }
  159.  
  160. FUNCTION {new.sentence.checkb}
  161. { empty$
  162.   swap$ empty$
  163.   and
  164.     'skip$
  165.     'new.sentence
  166.   if$
  167. }
  168.  
  169. FUNCTION {field.or.null}
  170. { duplicate$ empty$
  171.     { pop$ "" }
  172.     'skip$
  173.   if$
  174. }
  175.  
  176. FUNCTION {emphasize}
  177. { duplicate$ empty$
  178.     { pop$ "" }
  179.     { "{\em " swap$ * "}" * }
  180.   if$
  181. }
  182.  
  183. FUNCTION {boldface}
  184. { duplicate$ empty$
  185.     { pop$ "" }
  186.     { "{\bf " swap$ * "}" * }
  187.   if$
  188. }
  189.  
  190.  
  191. INTEGERS { nameptr namesleft numnames }
  192.  
  193. FUNCTION {format.names}
  194. { 's :=
  195.   #1 'nameptr :=
  196.   s num.names$ 'numnames :=
  197.   numnames 'namesleft :=
  198.     { namesleft #0 > }
  199.     { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
  200.       nameptr #1 >
  201.     { namesleft #1 >
  202.         { ", " * t * }
  203.         { numnames #2 >
  204.         { "," * }
  205.         'skip$
  206.           if$
  207.           t "others" =
  208.         { " et~al." * }
  209.         { " and " * t * }
  210.           if$
  211.         }
  212.       if$
  213.     }
  214.     't
  215.       if$
  216.       nameptr #1 + 'nameptr :=
  217.       namesleft #1 - 'namesleft :=
  218.     }
  219.   while$
  220. }
  221.  
  222. FUNCTION {format.authors}
  223. { author empty$
  224.     { "" }
  225.     { author format.names }
  226.   if$
  227. }
  228.  
  229. FUNCTION {format.editors}
  230. { editor empty$
  231.     { "" }
  232.     { editor format.names
  233.       editor num.names$ #1 >
  234.     { ", editors" * }
  235.     { ", editor" * }
  236.       if$
  237.     }
  238.   if$
  239. }
  240.  
  241. FUNCTION {format.title}
  242. { title empty$
  243.     { "" }
  244.     { "``" title "t" change.case$ * "''" * }
  245.   if$
  246. }
  247.  
  248. FUNCTION {n.dashify}
  249. { 't :=
  250.   ""
  251.     { t empty$ not }
  252.     { t #1 #1 substring$ "-" =
  253.     { t #1 #2 substring$ "--" = not
  254.         { "--" *
  255.           t #2 global.max$ substring$ 't :=
  256.         }
  257.         {   { t #1 #1 substring$ "-" = }
  258.         { "-" *
  259.           t #2 global.max$ substring$ 't :=
  260.         }
  261.           while$
  262.         }
  263.       if$
  264.     }
  265.     { t #1 #1 substring$ *
  266.       t #2 global.max$ substring$ 't :=
  267.     }
  268.       if$
  269.     }
  270.   while$
  271. }
  272.  
  273. FUNCTION {format.date}
  274. { year empty$
  275.     'year 
  276.     {" ("   year * ")" * }
  277.   if$
  278. }
  279.  
  280. FUNCTION {format.btitle}
  281. { title emphasize
  282. }
  283.  
  284. FUNCTION {tie.or.space.connect}
  285. { duplicate$ text.length$ #3 <
  286.     { "~" }
  287.     { " " }
  288.   if$
  289.   swap$ * *
  290. }
  291.  
  292. FUNCTION {either.or.check}
  293. { empty$
  294.     'pop$
  295.     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  296.   if$
  297. }
  298.  
  299. FUNCTION {format.bvolume}
  300. { volume empty$
  301.     { "" }
  302.     { "volume" volume tie.or.space.connect
  303.       series empty$
  304.     'skip$
  305.     { " of " * series emphasize * }
  306.       if$
  307.       "volume and number" number either.or.check
  308.     }
  309.   if$
  310. }
  311.  
  312. FUNCTION {format.number.series}
  313. { volume empty$
  314.     { number empty$
  315.     { series field.or.null }
  316.     { output.state mid.sentence =
  317.         { "number" }
  318.         { "Number" }
  319.       if$
  320.       number tie.or.space.connect
  321.       series empty$
  322.         { "there's a number but no series in " cite$ * warning$ }
  323.         { " in " * series * }
  324.       if$
  325.     }
  326.       if$
  327.     }
  328.     { "" }
  329.   if$
  330. }
  331.  
  332. FUNCTION {format.edition}
  333. { edition empty$
  334.     { "" }
  335.     { output.state mid.sentence =
  336.     { edition "l" change.case$ " edition" * }
  337.     { edition "t" change.case$ " edition" * }
  338.       if$
  339.     }
  340.   if$
  341. }
  342.  
  343. INTEGERS { multiresult }
  344.  
  345. FUNCTION {multi.page.check}
  346. { 't :=
  347.   #0 'multiresult :=
  348.     { multiresult not
  349.       t empty$ not
  350.       and
  351.     }
  352.     { t #1 #1 substring$
  353.       duplicate$ "-" =
  354.       swap$ duplicate$ "," =
  355.       swap$ "+" =
  356.       or or
  357.     { #1 'multiresult := }
  358.     { t #2 global.max$ substring$ 't := }
  359.       if$
  360.     }
  361.   while$
  362.   multiresult
  363. }
  364.  
  365. FUNCTION {format.pages}
  366. { pages empty$
  367.     { "" }
  368.     { pages multi.page.check
  369.     { ", pp." pages n.dashify tie.or.space.connect }
  370.     { ", p." pages tie.or.space.connect }
  371.       if$
  372.     }
  373.   if$
  374. }
  375.  
  376. FUNCTION {format.vol.num.pages}
  377. { volume field.or.null boldface
  378.   number empty$
  379.     'skip$
  380.     { "(" number * ")" * *
  381.       volume empty$
  382.     { "there's a number but no volume in " cite$ * warning$ }
  383.     'skip$
  384.       if$
  385.     }
  386.   if$
  387.   pages empty$
  388.     'skip$
  389.     { duplicate$ empty$
  390.     { pop$ format.pages }
  391.     { ", pp. " * pages n.dashify * }
  392.       if$
  393.     }
  394.   if$
  395. }
  396.  
  397. FUNCTION {format.chapter.pages}
  398. { chapter empty$
  399.     'format.pages
  400.     { type empty$
  401.     { "chapter" }
  402.     { type "l" change.case$ }
  403.       if$
  404.       chapter tie.or.space.connect
  405.       pages empty$
  406.     'skip$
  407.     { ", " * format.pages * }
  408.       if$
  409.     }
  410.   if$
  411. }
  412.  
  413. FUNCTION {format.in.ed.booktitle}
  414. { booktitle empty$
  415.     { "" }
  416.     { editor empty$
  417.     { "In " booktitle emphasize * }
  418.     { "In " format.editors * ", " * booktitle emphasize * }
  419.       if$
  420.     }
  421.   if$
  422. }
  423.  
  424. FUNCTION {empty.misc.check}
  425. { author empty$ title empty$ howpublished empty$
  426.   month empty$ year empty$ note empty$
  427.   and and and and and
  428.     { "all relevant fields are empty in " cite$ * warning$ }
  429.     'skip$
  430.   if$
  431. }
  432.  
  433. FUNCTION {format.thesis.type}
  434. { type empty$
  435.     'skip$
  436.     { pop$
  437.       type "t" change.case$
  438.     }
  439.   if$
  440. }
  441.  
  442. FUNCTION {format.tr.number}
  443. { type empty$
  444.     { "Technical Report" }
  445.     'type
  446.   if$
  447.   number empty$
  448.     { "t" change.case$ }
  449.     { number tie.or.space.connect }
  450.   if$
  451. }
  452.  
  453. FUNCTION {format.article.crossref}
  454. { key empty$
  455.     { journal empty$
  456.     { "need key or journal for " cite$ * " to crossref " * crossref *
  457.       warning$
  458.       ""
  459.     }
  460.     { "In {\em " journal * "\/}" * }
  461.       if$
  462.     }
  463.     { "In " key * }
  464.   if$
  465.   " \cite{" * crossref * "}" *
  466. }
  467.  
  468. FUNCTION {format.crossref.editor}
  469. { editor #1 "{vv~}{ll}" format.name$
  470.   editor num.names$ duplicate$
  471.   #2 >
  472.     { pop$ " et~al." * }
  473.     { #2 <
  474.     'skip$
  475.     { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  476.         { " et~al." * }
  477.         { " and " * editor #2 "{vv~}{ll}" format.name$ * }
  478.       if$
  479.     }
  480.       if$
  481.     }
  482.   if$
  483. }
  484.  
  485. FUNCTION {format.book.crossref}
  486. { volume empty$
  487.     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  488.       "In "
  489.     }
  490.     { "Volume" volume tie.or.space.connect
  491.       " of " *
  492.     }
  493.   if$
  494.   editor empty$
  495.   editor field.or.null author field.or.null =
  496.   or
  497.     { key empty$
  498.     { series empty$
  499.         { "need editor, key, or series for " cite$ * " to crossref " *
  500.           crossref * warning$
  501.           "" *
  502.         }
  503.         { "{\em " * series * "\/}" * }
  504.       if$
  505.     }
  506.     { key * }
  507.       if$
  508.     }
  509.     { format.crossref.editor * }
  510.   if$
  511.   " \cite{" * crossref * "}" *
  512. }
  513.  
  514. FUNCTION {format.incoll.inproc.crossref}
  515. { editor empty$
  516.   editor field.or.null author field.or.null =
  517.   or
  518.     { key empty$
  519.     { booktitle empty$
  520.         { "need editor, key, or booktitle for " cite$ * " to crossref " *
  521.           crossref * warning$
  522.           ""
  523.         }
  524.         { "In {\em " booktitle * "\/}" * }
  525.       if$
  526.     }
  527.     { "In " key * }
  528.       if$
  529.     }
  530.     { "In " format.crossref.editor * }
  531.   if$
  532.   " \cite{" * crossref * "}" *
  533. }
  534.  
  535. FUNCTION {article}
  536. { output.bibitem
  537.   format.authors "author" output.check
  538.   new.block
  539.   format.title "title" output.check
  540.   new.block
  541.   crossref missing$
  542.     { journal emphasize "journal" output.check
  543.       format.vol.num.pages output
  544.       format.date "year" output.check
  545.     }
  546.     { format.article.crossref output.nonnull
  547.       format.pages output
  548.     }
  549.   if$
  550.   new.block
  551.   note output
  552.   fin.entry
  553. }
  554.  
  555. FUNCTION {book}
  556. { output.bibitem
  557.   author empty$
  558.     { format.editors "author and editor" output.check }
  559.     { format.authors output.nonnull
  560.       crossref missing$
  561.     { "author and editor" editor either.or.check }
  562.     'skip$
  563.       if$
  564.     }
  565.   if$
  566.   new.block
  567.   format.btitle "title" output.check
  568.   crossref missing$
  569.     { format.bvolume output
  570.       new.block
  571.       format.number.series output
  572.       new.sentence
  573.       publisher "publisher" output.check
  574.       address output
  575.     }
  576.     { new.block
  577.       format.book.crossref output.nonnull
  578.     }
  579.   if$
  580.   format.edition output
  581.   format.date "year" output.check
  582.   new.block
  583.   note output
  584.   fin.entry
  585. }
  586.  
  587. FUNCTION {booklet}
  588. { output.bibitem
  589.   format.authors output
  590.   new.block
  591.   format.title "title" output.check
  592.   howpublished address new.block.checkb
  593.   howpublished output
  594.   address output
  595.   format.date output
  596.   new.block
  597.   note output
  598.   fin.entry
  599. }
  600.  
  601. FUNCTION {inbook}
  602. { output.bibitem
  603.   author empty$
  604.     { format.editors "author and editor" output.check }
  605.     { format.authors output.nonnull
  606.       crossref missing$
  607.     { "author and editor" editor either.or.check }
  608.     'skip$
  609.       if$
  610.     }
  611.   if$
  612.   new.block
  613.   format.btitle "title" output.check
  614.   crossref missing$
  615.     { format.bvolume output
  616.       format.chapter.pages "chapter and pages" output.check
  617.       new.block
  618.       format.number.series output
  619.       new.sentence
  620.       publisher "publisher" output.check
  621.       address output
  622.     }
  623.     { format.chapter.pages "chapter and pages" output.check
  624.       new.block
  625.       format.book.crossref output.nonnull
  626.     }
  627.   if$
  628.   format.edition output
  629.   format.date "year" output.check
  630.   new.block
  631.   note output
  632.   fin.entry
  633. }
  634.  
  635. FUNCTION {incollection}
  636. { output.bibitem
  637.   format.authors "author" output.check
  638.   new.block
  639.   format.title "title" output.check
  640.   new.block
  641.   crossref missing$
  642.     { format.in.ed.booktitle "booktitle" output.check
  643.       format.bvolume output
  644.       format.number.series output
  645.       format.chapter.pages output
  646.       new.sentence
  647.       publisher "publisher" output.check
  648.       address output
  649.       format.edition output
  650.       format.date "year" output.check
  651.     }
  652.     { format.incoll.inproc.crossref output.nonnull
  653.       format.chapter.pages output
  654.     }
  655.   if$
  656.   new.block
  657.   note output
  658.   fin.entry
  659. }
  660.  
  661. FUNCTION {inproceedings}
  662. { output.bibitem
  663.   format.authors "author" output.check
  664.   new.block
  665.   format.title "title" output.check
  666.   new.block
  667.   crossref missing$
  668.     { format.in.ed.booktitle "booktitle" output.check
  669.       format.bvolume output
  670.       format.number.series output
  671.       format.pages output
  672.       address empty$
  673.     { organization publisher new.sentence.checkb
  674.       organization output
  675.       publisher output
  676.       format.date "year" output.check
  677.     }
  678.     { address output.nonnull
  679.       format.date "year" output.check
  680.       new.sentence
  681.       organization output
  682.       publisher output
  683.     }
  684.       if$
  685.     }
  686.     { format.incoll.inproc.crossref output.nonnull
  687.       format.pages output
  688.     }
  689.   if$
  690.   new.block
  691.   note output
  692.   fin.entry
  693. }
  694.  
  695. FUNCTION {conference} { inproceedings }
  696.  
  697. FUNCTION {manual}
  698. { output.bibitem
  699.   author empty$
  700.     { organization empty$
  701.     'skip$
  702.     { organization output.nonnull
  703.       address output
  704.     }
  705.       if$
  706.     }
  707.     { format.authors output.nonnull }
  708.   if$
  709.   new.block
  710.   format.btitle "title" output.check
  711.   author empty$
  712.     { organization empty$
  713.     { address new.block.checka
  714.       address output
  715.     }
  716.     'skip$
  717.       if$
  718.     }
  719.     { organization address new.block.checkb
  720.       organization output
  721.       address output
  722.     }
  723.   if$
  724.   format.edition output
  725.   format.date output
  726.   new.block
  727.   note output
  728.   fin.entry
  729. }
  730.  
  731. FUNCTION {mastersthesis}
  732. { output.bibitem
  733.   format.authors "author" output.check
  734.   new.block
  735.   format.title "title" output.check
  736.   new.block
  737.   "Master's thesis" format.thesis.type output.nonnull
  738.   school "school" output.check
  739.   address output
  740.   format.date "year" output.check
  741.   new.block
  742.   note output
  743.   fin.entry
  744. }
  745.  
  746. FUNCTION {misc}
  747. { output.bibitem
  748.   format.authors output
  749.   title howpublished new.block.checkb
  750.   format.title output
  751.   howpublished new.block.checka
  752.   howpublished output
  753.   format.date output
  754.   new.block
  755.   note output
  756.   fin.entry
  757.   empty.misc.check
  758. }
  759.  
  760. FUNCTION {phdthesis}
  761. { output.bibitem
  762.   format.authors "author" output.check
  763.   new.block
  764.   format.btitle "title" output.check
  765.   new.block
  766.   "PhD thesis" format.thesis.type output.nonnull
  767.   school "school" output.check
  768.   address output
  769.   format.date "year" output.check
  770.   new.block
  771.   note output
  772.   fin.entry
  773. }
  774.  
  775. FUNCTION {proceedings}
  776. { output.bibitem
  777.   editor empty$
  778.     { organization output }
  779.     { format.editors output.nonnull }
  780.   if$
  781.   new.block
  782.   format.btitle "title" output.check
  783.   format.bvolume output
  784.   format.number.series output
  785.   address empty$
  786.     { editor empty$
  787.     { publisher new.sentence.checka }
  788.     { organization publisher new.sentence.checkb
  789.       organization output
  790.     }
  791.       if$
  792.       publisher output
  793.       format.date "year" output.check
  794.     }
  795.     { address output.nonnull
  796.       format.date "year" output.check
  797.       new.sentence
  798.       editor empty$
  799.     'skip$
  800.     { organization output }
  801.       if$
  802.       publisher output
  803.     }
  804.   if$
  805.   new.block
  806.   note output
  807.   fin.entry
  808. }
  809.  
  810. FUNCTION {techreport}
  811. { output.bibitem
  812.   format.authors "author" output.check
  813.   new.block
  814.   format.title "title" output.check
  815.   new.block
  816.   format.tr.number output.nonnull
  817.   institution "institution" output.check
  818.   address output
  819.   format.date "year" output.check
  820.   new.block
  821.   note output
  822.   fin.entry
  823. }
  824.  
  825. FUNCTION {unpublished}
  826. { output.bibitem
  827.   format.authors "author" output.check
  828.   new.block
  829.   format.title "title" output.check
  830.   new.block
  831.   note "note" output.check
  832.   format.date output
  833.   fin.entry
  834. }
  835.  
  836. FUNCTION {default.type} { misc }
  837.  
  838. MACRO {jan} {"January"}
  839.  
  840. MACRO {feb} {"February"}
  841.  
  842. MACRO {mar} {"March"}
  843.  
  844. MACRO {apr} {"April"}
  845.  
  846. MACRO {may} {"May"}
  847.  
  848. MACRO {jun} {"June"}
  849.  
  850. MACRO {jul} {"July"}
  851.  
  852. MACRO {aug} {"August"}
  853.  
  854. MACRO {sep} {"September"}
  855.  
  856. MACRO {oct} {"October"}
  857.  
  858. MACRO {nov} {"November"}
  859.  
  860. MACRO {dec} {"December"}
  861.  
  862. MACRO {acmcs} {"ACM Computing Surveys"}
  863.  
  864. MACRO {acta} {"Acta Informatica"}
  865.  
  866. MACRO {cacm} {"Communications of the ACM"}
  867.  
  868. MACRO {ibmjrd} {"IBM Journal of Research and Development"}
  869.  
  870. MACRO {ibmsj} {"IBM Systems Journal"}
  871.  
  872. MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  873.  
  874. MACRO {ieeetc} {"IEEE Transactions on Computers"}
  875.  
  876. MACRO {ieeetcad}
  877.  {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  878.  
  879. MACRO {ipl} {"Information Processing Letters"}
  880.  
  881. MACRO {jacm} {"Journal of the ACM"}
  882.  
  883. MACRO {jcss} {"Journal of Computer and System Sciences"}
  884.  
  885. MACRO {scp} {"Science of Computer Programming"}
  886.  
  887. MACRO {sicomp} {"SIAM Journal on Computing"}
  888.  
  889. MACRO {tocs} {"ACM Transactions on Computer Systems"}
  890.  
  891. MACRO {tods} {"ACM Transactions on Database Systems"}
  892.  
  893. MACRO {tog} {"ACM Transactions on Graphics"}
  894.  
  895. MACRO {toms} {"ACM Transactions on Mathematical Software"}
  896.  
  897. MACRO {toois} {"ACM Transactions on Office Information Systems"}
  898.  
  899. MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  900.  
  901. MACRO {tcs} {"Theoretical Computer Science"}
  902.  
  903. READ
  904.  
  905. STRINGS { longest.label }
  906.  
  907. INTEGERS { number.label longest.label.width }
  908.  
  909. FUNCTION {initialize.longest.label}
  910. { "" 'longest.label :=
  911.   #1 'number.label :=
  912.   #0 'longest.label.width :=
  913. }
  914.  
  915. FUNCTION {longest.label.pass}
  916. { number.label int.to.str$ 'label :=
  917.   number.label #1 + 'number.label :=
  918.   label width$ longest.label.width >
  919.     { label 'longest.label :=
  920.       label width$ 'longest.label.width :=
  921.     }
  922.     'skip$
  923.   if$
  924. }
  925.  
  926. EXECUTE {initialize.longest.label}
  927.  
  928. ITERATE {longest.label.pass}
  929.  
  930. FUNCTION {begin.bib}
  931. { preamble$ empty$
  932.     'skip$
  933.     { preamble$ write$ newline$ }
  934.   if$
  935.   "\begin{thebibliography}{"  longest.label  * "}" * write$ newline$
  936. }
  937.  
  938. EXECUTE {begin.bib}
  939.  
  940. EXECUTE {init.state.consts}
  941.  
  942. ITERATE {call.type$}
  943.  
  944. FUNCTION {end.bib}
  945. { newline$
  946.   "\end{thebibliography}" write$ newline$
  947. }
  948.  
  949. EXECUTE {end.bib}
  950.